﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="product_answer.aspx.cs"
    Inherits="V5_EShop._Template.Default.product_answer" %>

<%@ Import Namespace="V5_Common" %>
<%@ Register Src="Controls/getHeader2.ascx" TagName="getHeader2" TagPrefix="mm" %>
<%@ Register Src="Controls/getDismode.ascx" TagName="getDismode" TagPrefix="mm" %>
<%@ Register Src="Controls/getFooter.ascx" TagName="getFooter" TagPrefix="mm" %>
<%@ Register Src="Controls/getUserBrowseProductList.ascx" TagName="getUserBrowseProductList"
    TagPrefix="mm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/_template/<%=config.TemplatePath%>/css/Answer.css" rel="stylesheet"
        type="text/css" />
    <link href="/_template/<%=config.TemplatePath%>/css/init.css" rel="stylesheet" type="text/css" />
    <link href="/_template/<%=config.TemplatePath %>/css/head.css" rel="stylesheet" type="text/css">
    <meta name="author" content="美工：吕玲" />
    <title>我要提问</title>
    <script type="text/javascript" src="/scripts/jquery_min.js"> </script>
</head>
<body>
    <div id="page">
        <mm:getHeader2 ID="Header1" runat="server" />
        <div class="content">
            <a href="Integral.html">
                <img src="/_template/<%=config.TemplatePath%>/images/AllComments/banner.gif" width="950"
                    height="80"></a>
            <div class="left">
                <div class="Merchandise">
                    <a href="/product-details-<%=product.ID %>.aspx" class="a_01">
                        <img src="<%=product.ProductBigPic %>" width="150" height="205" /></a><a href="/product-details-<%=product.ID %>.aspx"
                            class="gray"><%=product.ProductName %></a><br />
                    <a class="gray_no">市场价：￥<%=product.ProductMarketPrice %></a><span class="red">团购价：￥<%=product.ProductMemberPrice %></span>
                    <input type="button" name="button" id="button" value="" class="button01" />
                    <input type="button" name="button2" id="button2" value="" class="button02" />
                </div>
                <ul class="ul04">
                    <h2>
                        我浏览过的商品</h2>
                    <mm:getUserBrowseProductList ID="getUserBrowseProductList" runat="server" />
                    <div class="clear">
                    </div>
                </ul>
            </div>
            <form id="form1" runat="server">
            <div class="right">
                <div class="right_top">
                    <strong class="name">问题：<%= m_ask.AskTitle %></strong>
                </div>
                <div class="clear">
                </div>
                <div class="ask">
                    <h2>
                        <%=m_user.GetModel(Input.SetInt(m_ask.MemberID)).UserName %>
                        提问：<%=m_ask.AskTitle%></h2>
                    <span>
                        <%=m_ask.AskContent%></span> <span><a href="/product-allask.aspx?productid=<%= m_ask.ProductID %>">查看全部问答</a>
                            <div class="clear">
                            </div>
                </div>
                <div class="Administrator">
                    <asp:Repeater ID="rpList" runat="server">
                        <ItemTemplate>
                            <h2>
                               <%#b_user.GetModel(Input.SetInt(DataBinder.Eval(Container.DataItem,"memberid"))).UserName %>回答：</h2>
                            <span><%#DataBinder.Eval(Container.DataItem, "AnswerContent")%></span>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>
                <div class="pager">
                    <webdiyer:AspNetPager ID="Pager" runat="server" AlwaysShow="True" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                        FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                        OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="10"
                        PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                        TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到">
                    </webdiyer:AspNetPager>
                </div>
                <table width="700" border="0" cellspacing="0" cellpadding="0" class="table01">
                    <tr>
                        <td width="109" align="right">
                            我来回答：
                        </td>
                        <td width="611" align="right">
                            <asp:TextBox ID="txtanswerContent" runat="server" CssClass="textarea01" TextMode="MultiLine"></asp:TextBox>
                            <span id="addTextWord">提示：做多发布500个字。</span>
                        </td>
                    </tr>
                </table>
                <asp:Button ID="btnSave" runat="server" Text="" CssClass="button04" />
                <asp:HiddenField ID="hfproductid" runat="server" Value="0" />
                <asp:HiddenField ID="hfaskid" runat="server" Value="0" />
            </div>
            </form>
        </div>
        <%--网站底部--%>
        <mm:getFooter ID="getFooter1" runat="server" />
    </div>
    
    <script type="text/javascript">
        $(function() {
            $("#btnSave").click(function() {
                return check_answer_form();
            });
            $("#txtanswerContent").keyup(function() {
            var s = $("#txtanswerContent").val();
            var nowlength = s.length;
            if ((500 - nowlength) < 0) {
                s = s.substring(0, 500);
                $("#txtanswerContent").val(s)
                return;
            }
            $("#addTextWord").html("已输入" + nowlength + "字，还可以输入" + (500 - nowlength) + "字");
            });
        });
        function check_answer_form() {
            if ($("#txtanswerContent").val() == "") {
                alert("回答内容不能为空!");
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
